package com.day0915;


import java.util.Arrays;
import java.util.Scanner;

public class ArrayTask {
    public static void main(String[] args) {
        int[] nums = {10,20,30,40,50,60};
        System.out.println(Arrays.toString(nums));
        Scanner in = new Scanner(System.in);
        System.out.println("请输入要删除的下标：");
        int index = in.nextInt();
        for (int i = index; i < nums.length  - 1; i ++){
            nums[i] = nums[i + 1];
        }
        nums = Arrays.copyOf(nums,nums.length - 1);
        System.out.println(Arrays.toString(nums));
    }
}
